﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Betop.Lib.Core.Right
{
    public interface IRecordRightDAL
    {
        string TableName
        {
            set;
        }

        /// <summary>
        /// 获得拥有者相应的绑定项
        /// </summary>
        /// <param name="iOwnerID"></param>
        /// <param name="iRightID"></param>
        /// <returns></returns>
        List<int> GetBindIDs(int ownerID, int rightID, int ownerType);

        /// <summary>
        /// 获得某条记录拥有该权限的拥有者
        /// </summary>
        /// <param name="iBindID"></param>
        /// <param name="iRightID"></param>
        /// <returns></returns>
        List<int> GetOwnerIDs(int bindID, int rightID, int ownerType);

        /// <summary>
        /// 保存拥有者相应的绑定项
        /// </summary>
        /// <param name="lstBindIDs"></param>
        /// <param name="iOwnerID"></param>
        /// <param name="iRightID"></param>
        /// <returns></returns>
        void SaveBindIDs(List<int> lstBindIDs, int ownerID, int rightID, int ownerType);

        /// <summary>
        /// 保存某一条记录的权限拥有者
        /// </summary>
        /// <param name="lstOwnerIDs"></param>
        /// <param name="iBindID"></param>
        /// <param name="iRightID"></param>
        /// <returns></returns>
        void SaveOwnerIDs(List<int> lstOwnerIDs, int bindID, int rightID, int ownerType);

        /// <summary>
        /// 判断是否拥有权限
        /// </summary>
        /// <param name="iBindID"></param>
        /// <param name="iOwnerID"></param>
        /// <param name="iRightID"></param>
        /// <returns></returns>
        bool HaveRight(int iBindID, int ownerID, int rightID, int ownerType); 
    }
}
